#@public@|cmd_info|Shows detailed information for a command
#@public_detailed@|cmd_info|Syntax 'make cmd_info cmd=<cmd> cmd_info'
#@public_detailed@|cmd_info|Where <cmd> is a valid command. Please, run the command 'make cmd_list' to show all the avaiable commands
cmd_info: setup
	$(show) ""                                                           ; \
	echo "------------------------------------------------------------"  ; \
	echo "Detailed information for command '$(cmd)'"                     ; \
	echo "------------------------------------------------------------"  ; \
	for mk in `find $(dir_tool)/mk/*.mk` ; do                              \
		cat "$$mk" | grep "@public_detailed@" | while read line ; do   \
			c=`echo $$line | cut -d '|' -f 2`                    ; \
			if [ "$$c" = "$(cmd)" ]; then                          \
				desc=`echo $$line | cut -d '|' -f 3`         ; \
				echo "$$desc" | $(line_formater)             ; \
			fi                                                   ; \
		done                                                         ; \
	done                                                                 ;



#@public@|cmd_list|Lists all the commands avaiable
#@public_detailed@|cmd_list|Syntax 'make cmd_list'
cmd_list:
	$(show) ""                                                           ; \
	echo "------------------------------------------------------------"  ; \
	echo "Lists all commands avaiable"                                   ; \
	echo "------------------------------------------------------------"  ; \
	echo ""                                                              ; \
	for mk in `find $(dir_tool)/mk/*.mk` ; do                              \
		aux1=`basename $$mk .mk`                                     ; \
		if [ $$aux1 != "basic" -a $$aux1 != "cmd" -a  $$aux1 != "info" \
                     -a  $$aux1 != "main" -a  $$aux1 != "private"              \
                     -a  $$aux1 != "public" -a  $$aux1 != "common" ]; then     \
			aux2=`echo $$aux1 | tr '[:lower:]' '[:upper:]'`      ; \
			echo ""                                              ; \
			echo ""                                              ; \
			echo "==========  $$aux2  =========="                ; \
			cmd_before=""                                        ; \
			cat $$mk | grep "@public@|" | while read line ; do     \
				cmd=`echo $$line | cut -d '|' -f 2`          ; \
				if [ "$$cmd" != "$$cmd_before" ]; then         \
					echo ""                              ; \
					echo ""                              ; \
					echo -n "'$$cmd': "                  ; \
					cmd_before="$$cmd"                   ; \
				fi                                           ; \
				desc=`echo $$line | cut -d '|' -f 3`         ; \
				echo "$$desc" | $(line_formater)             ; \
			done                                                 ; \
		fi                                                           ; \
	done                                                                 ; \
	echo ""                                                              ; \
	echo "------------------"                                            ; \
	echo "ATTENTION"                                                     ; \
	echo "------------------"                                            ; \
	echo "Please run 'make cmd_info cmd<cmd-name>' for detailed information on a command" ;






